chore(test): pin e2e fixture dependencies and migrate to npm#280
chore(test): pin e2e fixture dependencies and migrate to npm#280wyattjoh wants to merge 1 commit into
Conversation
|
|
Stack: wyattjoh/nextjs-pinned-range Part of a stacked PR chain. Do not merge manually. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a fixture-dependency utility module (scripts/lib/fixture-deps.ts) and tests, and integrates it into the refresh-e2e-fixtures script to apply package.json overrides, resolve dependency specs to exact versions, and validate pinned ranges. Migrates test log-capture from an AsyncLocalStorage-based API to a hook-style useCaptureLog() and replaces with a module-level active capture plus new log.ui() method; updates many tests, test stubs, and integration harnesses to use the new API. Updates spinner/logging to emit via log.ui(), refactors e2e fixture setup to createGetFixture()/Bun describe blocks and npx scaffolding, and pins numerous fixture package.json versions. Removes scripts/run-tests.ts. Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes |
3e50dc0 to
1514c5e
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/e2e/users-list.test.ts`:
- Around line 48-52: The test switched to awaiting Promise.all for
createTestUser but never populates createdIds, so afterAll cleanup doesn't
delete the created users; modify the code that calls createTestUser (the
Promise.all(...) result assigned to users) to extract and push each returned
user id into the existing createdIds array (or replace createdIds with
users.map(u => u.id)), ensuring the afterAll teardown logic that iterates
createdIds will actually delete the created users; reference the createTestUser
call site and the createdIds variable and the afterAll cleanup to make the
change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d63bd112-853f-4241-b00b-b8d1bcbd7f7a
⛔ Files ignored due to path filters (9)
test/e2e/fixtures/astro/package-lock.jsonis excluded by!**/package-lock.jsontest/e2e/fixtures/nextjs-app-router-next14/package-lock.jsonis excluded by!**/package-lock.jsontest/e2e/fixtures/nextjs-app-router/package-lock.jsonis excluded by!**/package-lock.jsontest/e2e/fixtures/nextjs-pages-router/package-lock.jsonis excluded by!**/package-lock.jsontest/e2e/fixtures/nuxt/package-lock.jsonis excluded by!**/package-lock.jsontest/e2e/fixtures/react-router/package-lock.jsonis excluded by!**/package-lock.jsontest/e2e/fixtures/react/package-lock.jsonis excluded by!**/package-lock.jsontest/e2e/fixtures/tanstack-start/package-lock.jsonis excluded by!**/package-lock.jsontest/e2e/fixtures/vue/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (86)
.claude/rules/e2e.md.claude/rules/logging.md.oxfmtrc.json.oxlintrc.jsonCONTRIBUTING.mdpackage.jsonpackages/cli-core/package.jsonpackages/cli-core/src/cli-program.tspackages/cli-core/src/commands/api/catalog.test.tspackages/cli-core/src/commands/api/index.test.tspackages/cli-core/src/commands/api/interactive.test.tspackages/cli-core/src/commands/api/ls.test.tspackages/cli-core/src/commands/apps/create.test.tspackages/cli-core/src/commands/apps/list.test.tspackages/cli-core/src/commands/auth/login.test.tspackages/cli-core/src/commands/auth/logout.test.tspackages/cli-core/src/commands/billing/index.test.tspackages/cli-core/src/commands/config/pull.test.tspackages/cli-core/src/commands/config/push.test.tspackages/cli-core/src/commands/config/schema.test.tspackages/cli-core/src/commands/deploy/index.test.tspackages/cli-core/src/commands/doctor/context.test.tspackages/cli-core/src/commands/env/pull.test.tspackages/cli-core/src/commands/init/index.test.tspackages/cli-core/src/commands/init/scan.test.tspackages/cli-core/src/commands/link/index.test.tspackages/cli-core/src/commands/open/index.test.tspackages/cli-core/src/commands/orgs/index.test.tspackages/cli-core/src/commands/switch-env/index.test.tspackages/cli-core/src/commands/unlink/index.test.tspackages/cli-core/src/commands/users/create.test.tspackages/cli-core/src/commands/users/list.test.tspackages/cli-core/src/commands/users/menu.test.tspackages/cli-core/src/commands/users/open.test.tspackages/cli-core/src/commands/whoami/index.test.tspackages/cli-core/src/lib/auth-server.test.tspackages/cli-core/src/lib/autoclaim.test.tspackages/cli-core/src/lib/autolink.test.tspackages/cli-core/src/lib/bapi-command.test.tspackages/cli-core/src/lib/first-application.test.tspackages/cli-core/src/lib/keyless.test.tspackages/cli-core/src/lib/log.test.tspackages/cli-core/src/lib/log.tspackages/cli-core/src/lib/spinner.tspackages/cli-core/src/test/integration/lib/harness.tspackages/cli-core/src/test/lib/stubs.tsscripts/lib/fixture-deps.test.tsscripts/lib/fixture-deps.tsscripts/refresh-e2e-fixtures.tsscripts/run-tests.tstest/e2e/astro.test.tstest/e2e/fixtures/astro/README.mdtest/e2e/fixtures/astro/package.jsontest/e2e/fixtures/nextjs-app-router-next14/package.jsontest/e2e/fixtures/nextjs-app-router/package.jsontest/e2e/fixtures/nextjs-pages-router/package.jsontest/e2e/fixtures/nuxt/package.jsontest/e2e/fixtures/react-router/app/routes/home.tsxtest/e2e/fixtures/react-router/package.jsontest/e2e/fixtures/react-router/tsconfig.jsontest/e2e/fixtures/react-router/vite.config.tstest/e2e/fixtures/react/index.htmltest/e2e/fixtures/react/package.jsontest/e2e/fixtures/tanstack-start/AGENTS.mdtest/e2e/fixtures/tanstack-start/README.mdtest/e2e/fixtures/tanstack-start/package.jsontest/e2e/fixtures/vue/index.htmltest/e2e/fixtures/vue/package.jsontest/e2e/fixtures/vue/src/App.vuetest/e2e/fixtures/vue/src/components/HelloWorld.vuetest/e2e/lib/dev-server.tstest/e2e/lib/fixture-setup.tstest/e2e/lib/fixture-test.tstest/e2e/lib/logger.tstest/e2e/lib/test-user.tstest/e2e/lib/types.tstest/e2e/nextjs-app-router-next14.test.tstest/e2e/nextjs-app-router.test.tstest/e2e/nextjs-pages-router.test.tstest/e2e/nuxt.test.tstest/e2e/react-router.test.tstest/e2e/react.test.tstest/e2e/tanstack-start.test.tstest/e2e/tsconfig.jsontest/e2e/users-list.test.tstest/e2e/vue.test.ts
💤 Files with no reviewable changes (4)
- test/e2e/fixtures/react-router/app/routes/home.tsx
- scripts/run-tests.ts
- test/e2e/fixtures/react-router/tsconfig.json
- test/e2e/fixtures/tanstack-start/AGENTS.md
✅ Files skipped from review due to trivial changes (18)
- .oxfmtrc.json
- test/e2e/fixtures/nuxt/package.json
- test/e2e/fixtures/nextjs-pages-router/package.json
- test/e2e/fixtures/astro/package.json
- CONTRIBUTING.md
- test/e2e/fixtures/vue/src/components/HelloWorld.vue
- packages/cli-core/src/commands/users/menu.test.ts
- packages/cli-core/src/commands/doctor/context.test.ts
- test/e2e/fixtures/vue/src/App.vue
- test/e2e/fixtures/vue/index.html
- test/e2e/fixtures/tanstack-start/README.md
- packages/cli-core/src/cli-program.ts
- packages/cli-core/package.json
- test/e2e/fixtures/react/index.html
- test/e2e/fixtures/nextjs-app-router-next14/package.json
- .oxlintrc.json
- packages/cli-core/src/lib/auth-server.test.ts
- test/e2e/fixtures/astro/README.md
🚧 Files skipped from review as they are similar to previous changes (7)
- test/e2e/fixtures/nextjs-app-router/package.json
- test/e2e/fixtures/react-router/package.json
- scripts/lib/fixture-deps.test.ts
- test/e2e/lib/types.ts
- scripts/lib/fixture-deps.ts
- scripts/refresh-e2e-fixtures.ts
- test/e2e/fixtures/vue/package.json
88c14ab to
2ca4be0
Compare
…ture lifecycle
Pin every E2E fixture project's dependencies and check in package-lock.json
files so fixture installs are reproducible and skip scaffolding the upstream
templates from scratch on each run. Switch fixtures from bun-based installs
to npm to match what users would do on a freshly scaffolded app.
Replace the useFixture helper with createGetFixture, returning
{ fixture, users } so each test owns its own user lifecycle and tracks
created users for explicit cleanup. Add scripts/lib/fixture-deps for the
shared pinning logic plus tests.
Migrate test infrastructure off scripts/run-tests.ts to native
bun test --parallel for both unit and E2E pipelines, and fold test/e2e
into the lint, format, and typecheck commands.
2ca4be0 to
5e0198f
Compare
Summary
Reproducibility, harness ergonomics, and test-runtime consolidation for the e2e suite.
The e2e fixture tooling moves from
bunx/bun installontonpx/npm ciwith a committedpackage-lock.jsonin each fixture, and every non-Clerk dependency is resolved to an exact version throughnpm viewat refresh time so scaffolded projects no longer drift between runs. Scaffolders that change behavior across majors are pinned through an explicitpinnedDependencyRangesconfig, replacing the olderpinned: boolean+--forceflag, and a TanStack peer-dependency mismatch is now expressed declaratively viapackageJsonOverrides. The resolution, override, and validation logic lives in a newscripts/lib/fixture-deps.tsmodule covered by its own unit tests.The e2e harness drops the
useFixturestyle in favor ofcreateGetFixture, which returns a fixture getter alongside a per-test users API that auto-cleans created users inafterEach. The fixture object is reshaped to{ fixture, users }and its public types are derived from the cleanup-bearing internals viaOmit, keeping cleanup hooks internal. A newrunFileExistsTesthelper coversclerk initartifact assertions, a dedicatedtest/e2e/tsconfig.jsonbrings the e2e tree underbun run typecheck, and e2e logging is silenced unlessCLERK_E2E_DEBUG=1.The custom
scripts/run-tests.tswrapper is dropped in favor of runningbun test --paralleldirectly, which implies--isolateand gives module-state isolation between test files for free. Lint and format coverage now extend overtest/e2e/, with an.oxfmtrc.jsonthat excludes fixture lockfiles and a no-console oxlint override scoped to the e2e tree where the logger is a deliberate console wrapper.Test plan
bun run format:checkbun run lintbun run typecheckbun run testbun run test:e2e:op